package io.gitee.wminyu.day02;

import java.util.Scanner;

public class sum {
    public static void main(String[] args){
        long m;
        Scanner input = new Scanner(System.in);
        m = input.nextLong();
        sumDigits(m);
    }
    public static void sumDigits (long n){
        int count=0;
        long N = n;
        while (n!=0){
            n=n/10;
            count++;
        }
        System.out.println("这是一个"+count+"位数");
        long sum=0;
        for(int i=0;i<count;i++)
        {
            sum += (long)(N % Math.pow(10,1));
//            System.out.println(sum);
            N = N / 10;
//            System.out.println(N);
        }
        System.out.println(sum);

    }
}
